<!DOCTYPE html>
<html>
<head>
<title>经营主体</title>
<#include "/header.html">
</head>
<body>
<div id="witapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.key" @keyup.enter="query" placeholder="经营主体名称">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("subject:save")>
            <a class="btn btn-success" @click="addSubject"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("subject:update")>
            <a class="btn btn-success" @click="editSubject"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
			</#if>
            <#if shiro.hasPermission("subject:update")>
            <a class="btn btn-success" @click="update"><i class="fa fa-eye"></i>&nbsp;查看</a>
			</#if>
			<#if shiro.hasPermission("subject:delete")>
            <a class="btn btn-success" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
        <div style="display:flex;flex-direction:row;">
            <div>
                <form class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">经营主体名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.name" placeholder="经营主体名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">主体类型</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.identityName" placeholder="身份类型名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">联系人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.linkMan" placeholder="联系人"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">联系电话</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.linkTel" placeholder="联系电话"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属省份</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.provinceName" placeholder="所属省份"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属地市</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.cityName" placeholder="地市"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属区县</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.countyName" placeholder="区县"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属乡镇</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.villagesName" placeholder="乡镇"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属村组</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="subject.hamletName" placeholder="村组"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">状态</div>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="0" v-model="subject.status"/> 禁用
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="1" v-model="subject.status"/> 正常
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label"></div>
                        <input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                    </div>
                </form>
            </div>
            <div>
                <div style="display:flex;flex-direction:column;padding-top:20px;">
                    <div>企业图片</div>
                    <div class="graphics"></div>
                </div>
            </div>
        </div>
	</div>
</div>
<div id="div_subject_dialog" style="display:none">
    <form class="form-horizontal">
        <div class="form-group" id="div_subject_username" style="display:none;">
            <div class="col-sm-2 control-label">登录账号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="user_name" placeholder="主体的登录账号|手机号码"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">主体名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="name" placeholder="经营主体的名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">主体类型</div>
            <div class="col-sm-10">
                <select id="identity_id" class="form-control"></select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">联系人</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="link_man" placeholder="联系人"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">联系电话</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="link_tel" placeholder="联系电话"/>
            </div>
        </div>
        <div class="form-group areaSelectText">
            <div class="col-sm-2 control-label">区域位置</div>
            <div class="col-sm-10">
                <div id="div_area_import">
                    <select class="col-sm-12 form-control clsProvince" id="farmProvinceId" style="cursor:pointer;" onchange="thisPage.getAreaData(this.value,'#div_area_import','.clsCity','请选择市|区');"><option value=''></option></select>
                    <select class="col-sm-12 form-control clsCity" id="farmCityId" style="display:none;margin-top:4px;cursor:pointer;" onchange="thisPage.getAreaData(this.value,'#div_area_import','.clsCounty','请选择区|县|市');"><option value=''></option></select>
                    <select class="col-sm-12 form-control clsCounty" id="farmCountyId" style="display:none;margin-top:4px;cursor:pointer;" onchange="thisPage.getAreaData(this.value,'#div_area_import','.clsTowns','请选择乡|镇|社区');"><option value=''></option></select>
                    <select class="col-sm-12 form-control clsTowns" id="farmTownsId" style="display:none;margin-top:4px;cursor:pointer;" onchange="thisPage.getAreaData(this.value,'#div_area_import','.clsVallage','请选择村|组');"><option value=''></option></select>
                    <select class="col-sm-12 form-control clsVallage" id="farmVallageId" style="display:none;margin-top:4px;cursor:pointer;" onchange="thisPage.getAreaData(this.value,'#div_area_import','.clsXxx','请选择区域');"><option value=''></option></select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">状态</div>
            <label class="radio-inline">
                <input type="radio" name="status" value="0"/>禁用
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" value="1"/>正常
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">企业图片</div>
            <div class="col-sm-10">
                <input type="file" id="framImages" title="选择企业图片" placeholder="选择企业图片">
            </div>
        </div>
        <div class="form-group" id="showImages" style="display:none;"></div>
    </form>
</div>
<script src="${request.contextPath}/statics/js/modules/wit/subject.js?_${.now?long}"></script>
</body>
</html>